package it.eng.area118.mdocommon.android.rest;

import it.eng.area118.mdocommon.HasService;
import it.eng.area118.mdocommon.android.command.AndroidCommand;
import it.eng.area118.mdocommon.android.log.BasicLogger;

public abstract class RestServiceCommand<Params, Result> extends
		AndroidCommand<Params, Result> implements
		HasService<RestServiceEndPoint<Result>> {


	

	private static final String TAG = "RestServiceCommand";

	
	
	// protected boolean wait;

	// public RestServiceCommand(boolean wait) {
	// this.wait = wait;
	// }
	
	

	protected Result doCommand(Params... params) throws Exception {
		Params p1 = params[0];
		BasicLogger.writeLog(TAG, "doCommand: " + p1);
		return RestServiceInvoker.getInstance().<Params, Result> invoke(
				getServiceEndPoint(), p1);
	};

	@Override
	public abstract void before();

	@Override
	public abstract void after();

}
